package com.anyou.mall.goo.goodsSku.service.impl;

import java.util.List;
import com.anyou.common.utils.DateUtils;
import com.anyou.mall.order.orderGoods.domain.OrdOrderGoods;
import com.anyou.mall.order.orderGoods.mapper.OrdOrderGoodsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.anyou.mall.goo.goodsSku.mapper.GooGoodsSkuMapper;
import com.anyou.mall.goo.goodsSku.domain.GooGoodsSku;
import com.anyou.mall.goo.goodsSku.service.IGooGoodsSkuService;

/**
 * 商品sku规格组合Service业务层处理
 *
 * @author xq
 * @date 2022-03-28
 */
@Service
public class GooGoodsSkuServiceImpl extends ServiceImpl<GooGoodsSkuMapper, GooGoodsSku> implements IGooGoodsSkuService
{
    @Autowired
    private GooGoodsSkuMapper gooGoodsSkuMapper;

    /**
     * 查询商品sku规格组合
     *
     * @param goodsSkuId 商品sku规格组合主键
     * @return 商品sku规格组合
     */
    @Override
    public GooGoodsSku selectGooGoodsSkuByGoodsSkuId(Long goodsSkuId)
    {
        return gooGoodsSkuMapper.selectGooGoodsSkuByGoodsSkuId(goodsSkuId);
    }

    /**
     * 查询商品sku规格组合列表
     *
     * @param gooGoodsSku 商品sku规格组合
     * @return 商品sku规格组合
     */
    @Override
    public List<GooGoodsSku> selectGooGoodsSkuList(GooGoodsSku gooGoodsSku)
    {
        return gooGoodsSkuMapper.selectGooGoodsSkuList(gooGoodsSku);
    }

    /**
     * 新增商品sku规格组合
     *
     * @param gooGoodsSku 商品sku规格组合
     * @return 结果
     */
    @Override
    public int insertGooGoodsSku(GooGoodsSku gooGoodsSku)
    {
        gooGoodsSku.setCreateTime(DateUtils.getNowDate());
        return gooGoodsSkuMapper.insertGooGoodsSku(gooGoodsSku);
    }

    /**
     * 修改商品sku规格组合
     *
     * @param gooGoodsSku 商品sku规格组合
     * @return 结果
     */
    @Override
    public int updateGooGoodsSku(GooGoodsSku gooGoodsSku)
    {
        gooGoodsSku.setUpdateTime(DateUtils.getNowDate());
        return gooGoodsSkuMapper.updateGooGoodsSku(gooGoodsSku);
    }

    /**
     * 批量删除商品sku规格组合
     *
     * @param goodsSkuIds 需要删除的商品sku规格组合主键
     * @return 结果
     */
    @Override
    public int deleteGooGoodsSkuByGoodsSkuIds(Long[] goodsSkuIds)
    {
        return gooGoodsSkuMapper.deleteGooGoodsSkuByGoodsSkuIds(goodsSkuIds);
    }

    /**
     * 删除商品sku规格组合信息
     *
     * @param goodsSkuId 商品sku规格组合主键
     * @return 结果
     */
    @Override
    public int deleteGooGoodsSkuByGoodsSkuId(Long goodsSkuId)
    {
        return gooGoodsSkuMapper.deleteGooGoodsSkuByGoodsSkuId(goodsSkuId);
    }
}
